<!DOCTYPE html>
<html>
{include file="public/header" /}

<style>
    .layui-inline{width: 100%}
    .layui-form-label{width: 15%}
    .layui-form-item .layui-input-inline {
        float: left;
        width: 80%;
        margin-right: 10px;
    }
    .layui-form-label {
        padding: 9px 1px;
        text-align: left;
    }
    .form-footer2 {
         background-color: #ffffff;
         height: 0px;
         padding-top: 0px;
    }
</style>
<body>

<div class="layui-fluid" id="app" style="margin-top: 0px">

    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">


                <div class="layui-card-body">
                    <form class="layui-form" action="" lay-filter="component-form-group">

                        <div class="layui-card-body" style="padding: 15px;">

                            <input type="hidden" name="id" value="{$item.id}">

                            <div class="layui-form-item">
                                <div class="layui-inline">
                                    <label class="layui-form-label">商家</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="name1" value="{$item.name1}" class="layui-input"
                                               placeholder="" readonly="readonly" lay-verify="required">
                                    </div>
                                </div>


                                <div class="layui-inline">
                                    <label class="layui-form-label">供应商</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="name2" value="{$item.name2}" class="layui-input"
                                               placeholder=""    readonly="readonly" lay-verify="required">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">订单状态</label>
                                    <div class="layui-input-block">
                                        <input type="radio" name="status" value="2" {if condition="$item.status==2" }
                                               checked="" {/if} title="待处理">
                                        <input type="radio" name="status" value="1" title="处理中" {if
                                               condition="$item.status==1" } checked="" {/if}>
                                        <input type="radio" name="status" value="0" {if condition="$item.status==0" }
                                               checked="" {/if} title="已完成">

                                    </div>
                                </div>


                                <div class="layui-form-item layui-form-text">
                                    <div class="layui-inline">
                                        <label class="layui-form-label">请填写描述</label>
                                        <div class="layui-input-inline">
                                            <textarea placeholder="请输入内容"   name="desc" class="layui-textarea"></textarea>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="layui-form-item form-footer2">
                                <div class="layui-input-block">
                                    <button class="layui-btn" type="button" lay-submit lay-filter="bianji">保存</button>
                                </div>
                            </div>

                        </div>

                    </form>
                </div>

        </div>
    </div>


</div>
</body>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            tp: ""
        },

    });

    layui.use(['form', 'laydate', 'upload'], function () {
        var $ = layui.$
            , element = layui.element
            , layer = layui.layer
            , laydate = layui.laydate
            , form = layui.form;
        var upload = layui.upload;

        form.render(null, 'component-form-group');

        laydate.render({
            elem: '#LAY-component-form-group-date'
        });






        /* 监听提交 */
        form.on('submit(bianji)', function (data) {

            var index = layer.confirm('确认继续执行？', {
                btn: ['确定', '取消'] //按钮
            }, function () {
                $.post('{:url("edit")}', data.field, function (res) {
                    if (res.code == 1) {

                        //将数据传入到父元素
//                        parent.app.items.push(data.field);
//                        $('.layui-form')[0].reset();
                        parent.init();
                        parent.layer.closeAll();
                        parent.layer.msg(res.msg, {icon: 1})
//                        $('#phone').val('');


                        return false;
                    } else {
                        parent.layer.msg(res.msg, {icon: 2})
                        return false;
                    }
                });
            }, function () {
                layer.close(index);
            });




            return false;
        });
    });





</script>
</html>










